//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.UIDesigner.Monitor
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Research.DataLayer;
    using System.Collections.ObjectModel;

    public interface IDataProductService
    {
        /// <summary>
        /// Raised whenever the DataProduct get updated 
        /// </summary>
        event EventHandler<DataProductEventArgs> DataProductReceived;

        /// <summary>
        /// Event hander for update status
        /// </summary>
        event EventHandler<JobStatusEventArgs> UpdateStatus;

        /// <summary>
        /// Raised whenever datamodel needs to be cleared
        /// </summary>
        event EventHandler Clear;

        /// <summary>
        /// The maximum reconnection attempts if the connection is not alive.
        /// </summary>
        int MaxRegistryConnectionAttempts { get; set; }

        /// <summary>
        /// Gets or sets the polling connection.
        /// </summary>
        /// <value>The polling connection.</value>
        Connection PollingConnection { get; set; }

        /// <summary>
        /// Starts Data product Service
        /// </summary>
        /// <param name="jobId"></param>
        /// <param name="poolConnection"></param>
        void StartDataProductService(Guid jobId, Connection poolConnection);
       
        /// <summary>
        /// Generates the data product item.
        /// </summary>
        /// <param name="dataProductID">The data product ID.</param>
        /// <returns></returns>
        DataProductItem GenerateDataProductItem(Guid dataProductId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dataproductId"></param>
        /// <returns></returns>
        void GetDataProductInfo(Guid dataProductId, ObservableCollection<DataProductItem> dataProducts);

        /// <summary>
        /// Clears the subscribers
        /// </summary>
        void ClearModel();

        /// <summary>
        /// Stop the service
        /// </summary>
        void HaltService();

        /// <summary>
        /// Clears the temp data.
        /// </summary>
        void ClearTempData();
    }
}
